package org.jsola.hr.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import org.jsola.core.dto.BaseDTO;
import org.jsola.core.validator.Const;
import org.jsola.hr.constant.ContractDateEnum;
import org.jsola.hr.constant.ContractStatusEnum;
import org.jsola.hr.constant.FileType;

import java.util.Date;
import javax.validation.constraints.NotNull;

import static org.jsola.core.example.BaseExample.E_ID;
import static org.jsola.core.example.BaseExample.M_ID_NOT_NULL;
import static org.jsola.core.example.BaseExample.N_ID;
import static org.jsola.hr.example.EmpPaperContractExample.E_COMPANY_ID;
import static org.jsola.hr.example.EmpPaperContractExample.E_COMPANY_NAME;
import static org.jsola.hr.example.EmpPaperContractExample.E_EMP_ID;
import static org.jsola.hr.example.EmpPaperContractExample.E_END_TIME;
import static org.jsola.hr.example.EmpPaperContractExample.E_FILE;
import static org.jsola.hr.example.EmpPaperContractExample.E_NAME;
import static org.jsola.hr.example.EmpPaperContractExample.E_NUMBER;
import static org.jsola.hr.example.EmpPaperContractExample.E_REMARKS;
import static org.jsola.hr.example.EmpPaperContractExample.E_START_TIME;
import static org.jsola.hr.example.EmpPaperContractExample.E_STATUS;
import static org.jsola.hr.example.EmpPaperContractExample.E_SUBSCRIBE_TIME;
import static org.jsola.hr.example.EmpPaperContractExample.E_TIME_LIMIT;
import static org.jsola.hr.example.EmpPaperContractExample.E_TIME_LIMIT_TYPE;
import static org.jsola.hr.example.EmpPaperContractExample.E_TYPE;
import static org.jsola.hr.example.EmpPaperContractExample.M_COMPANY_ID_MAX;
import static org.jsola.hr.example.EmpPaperContractExample.M_COMPANY_NAME_MAX;
import static org.jsola.hr.example.EmpPaperContractExample.M_EMP_ID_MAX;
import static org.jsola.hr.example.EmpPaperContractExample.M_FILE_MAX;
import static org.jsola.hr.example.EmpPaperContractExample.M_NAME_MAX;
import static org.jsola.hr.example.EmpPaperContractExample.M_NUMBER_MAX;
import static org.jsola.hr.example.EmpPaperContractExample.M_REMARKS_MAX;
import static org.jsola.hr.example.EmpPaperContractExample.M_STATUS_ENUM_NOT_MATCH;
import static org.jsola.hr.example.EmpPaperContractExample.M_TIME_LIMIT_TYPE_ENUM_NOT_MATCH;
import static org.jsola.hr.example.EmpPaperContractExample.M_TYPE_ENUM_NOT_MATCH;
import static org.jsola.hr.example.EmpPaperContractExample.M_TYPE_MAX;
import static org.jsola.hr.example.EmpPaperContractExample.N_COMPANY_ID;
import static org.jsola.hr.example.EmpPaperContractExample.N_COMPANY_NAME;
import static org.jsola.hr.example.EmpPaperContractExample.N_EMP_ID;
import static org.jsola.hr.example.EmpPaperContractExample.N_END_TIME;
import static org.jsola.hr.example.EmpPaperContractExample.N_FILE;
import static org.jsola.hr.example.EmpPaperContractExample.N_NAME;
import static org.jsola.hr.example.EmpPaperContractExample.N_NUMBER;
import static org.jsola.hr.example.EmpPaperContractExample.N_REMARKS;
import static org.jsola.hr.example.EmpPaperContractExample.N_START_TIME;
import static org.jsola.hr.example.EmpPaperContractExample.N_STATUS;
import static org.jsola.hr.example.EmpPaperContractExample.N_SUBSCRIBE_TIME;
import static org.jsola.hr.example.EmpPaperContractExample.N_TIME_LIMIT;
import static org.jsola.hr.example.EmpPaperContractExample.N_TIME_LIMIT_TYPE;
import static org.jsola.hr.example.EmpPaperContractExample.N_TYPE;

/**
 * 纸质合同
 *
 * @author zhr
 */
@EqualsAndHashCode(callSuper = true)
@ApiModel(description = "修改【纸质合同】的参数")
@Data
public class EmpPaperContractUpdateDTO extends BaseDTO {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(notes = N_ID, example = E_ID, required = true)
    @NotNull(message = M_ID_NOT_NULL)
    private String id;

    @ApiModelProperty(notes = N_COMPANY_ID, example = E_COMPANY_ID)
    @Length(max = 32, message = M_COMPANY_ID_MAX)
    private String companyId;

    @ApiModelProperty(notes = N_EMP_ID, example = E_EMP_ID)
    @Length(max = 32, message = M_EMP_ID_MAX)
    private String empId;

    @ApiModelProperty(notes = N_NUMBER, example = E_NUMBER)
    @Length(max = 50, message = M_NUMBER_MAX)
    private String number;

    @ApiModelProperty(notes = N_TYPE, example = E_TYPE, allowableValues = FileType.VALUES_STR)
    @Length(max = 64, message = M_TYPE_MAX)
    @Const(constClass = FileType.class, message = M_TYPE_ENUM_NOT_MATCH)
    private String type;

    @ApiModelProperty(notes = N_NAME, example = E_NAME)
    @Length(max = 80, message = "名称长度不能超过80")
    private String name;

    @ApiModelProperty(notes = N_TIME_LIMIT, example = E_TIME_LIMIT)
    private Integer timeLimit;

    @ApiModelProperty(notes = N_TIME_LIMIT_TYPE, example = E_TIME_LIMIT_TYPE, allowableValues = ContractDateEnum.VALUES_STR)
    @Const(constClass = ContractDateEnum.class, message = M_TIME_LIMIT_TYPE_ENUM_NOT_MATCH)
    private Integer timeLimitType;

    @ApiModelProperty(notes = N_START_TIME, example = E_START_TIME)
    private Date startTime;

    @ApiModelProperty(notes = N_END_TIME, example = E_END_TIME)
    private Date endTime;

    @ApiModelProperty(notes = N_COMPANY_NAME, example = E_COMPANY_NAME)
    @Length(max = 100, message = M_COMPANY_NAME_MAX)
    private String companyName;

    @ApiModelProperty(notes = N_STATUS, example = E_STATUS, allowableValues = ContractStatusEnum.VALUES_STR)
    @Const(constClass = ContractStatusEnum.class, message = M_STATUS_ENUM_NOT_MATCH)
    private Integer status;

    @ApiModelProperty(notes = N_SUBSCRIBE_TIME, example = E_SUBSCRIBE_TIME)
    private Date subscribeTime;

    @ApiModelProperty(notes = N_REMARKS, example = E_REMARKS)
    @Length(max = 2147483647, message = M_REMARKS_MAX)
    private String remarks;

    @ApiModelProperty(notes = N_FILE, example = E_FILE)
    @Length(max = 2147483647, message = M_FILE_MAX)
    private String file;


}

